import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'package:get/get.dart';

import '../../../event/WkEventListener.dart';
import '../../../style/app_colors.dart';
import '../../../widget/CommonWidgets.dart';
import '../controllers/wifi_password2_controller.dart';

class WifiPassword2View extends GetView<WifiPassword2Controller> {
  const WifiPassword2View({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          icon: Image.asset('assets/images/ic_back2.png',width: 48.w,height: 48.h),
          onPressed: () {
            Get.back();
          },
          tooltip: MaterialLocalizations.of(context).backButtonTooltip, // 可选：设置工具提示
        ),
      ),
      body: Obx(()=>Container(
        padding: EdgeInsets.all(25.w),
        child:Column(
          children: [
            SizedBox(height: 40.h,),
            Text('输入Wi-Fi密码',style: TextStyle(fontSize: 48.sp)),
            SizedBox(height: 10.h,),
            Text(controller.wifiInfo.value.s!,style: TextStyle(fontSize: 32.sp,color: AppColors.Sub_Title_Color)),
            SizedBox(height: 50.h,),
            CommonWidgets.getEditFiledOfPw_WithoutBox(controller.passwordTextEdit.value, controller.pwVisible.value,
                context, WkEventListener(
                    onClick: (v) {
                      controller.pwVisible.value = !controller.pwVisible.value;
                    }
                )),

            SizedBox(height: 52.h,),
            GestureDetector(
              onTap: () {
                Get.back();
              },
              child: Text('选择其他wifi',style: TextStyle(color: Colors.blue),),
            ),
            SizedBox(height: 30.h,),
            Container(
              margin: const EdgeInsets.only(top: 50),
              width: double.infinity,
              child: ElevatedButton(
                  onPressed: () {
                    controller.configRoboteWifiPw();
                  },
                  child:  Text("完成")
              ),
            )

          ],
        ),
      )),
    );
  }
}
